var CWContact = require('./cwcontact').CWContact;

// Construire un nouvel object CWContact
var c = new CWContact();
c.firstname('Simon').name('Renoult')
    .address('14bis rue beauregard, 10000 TROYES')
    .organisation().push('UTT');

var c2 = new CWContact();
c2.firstname('Adrien').name('Amoros')
    .address('100 foo bar, 12345 FooBAZ')
    .tel('0123456789')
    .organisation().push('UTT');

console.log(c.compare(c2));
c.merge(c2);
console.log(c);

console.log(c.toCSV());


var c3 = new CWContact();
var vcard = 'BEGIN:VCARD\n' +
                'VERSION:3.0\n' +
                'N:"foo"\n' +
                'FN:"foo bar"\n' +
                'ORG:"baz"\n' +
                'TITLE:"foo, baz"\n' +
                'TEL;type=WORK:"0123456789"\n' +
                'EMAIL;TYPE=PREF,INTERNET:"foo@bar.com"\n' +
                'END:VCARD';
console.log(c3);
c3.fromVCard(vcard);
console.log(c3);
